op {
  graph_op_name: "LSTMBlockCell"
  visibility: HIDDEN
  in_arg {
    name: "x"
    description: <<END
The input to the LSTM cell, shape (batch_size, num_inputs).
END
  }
  in_arg {
    name: "cs_prev"
    description: <<END
Value of the cell state at previous time step.
END
  }
  in_arg {
    name: "h_prev"
    description: <<END
Output of the previous cell at previous time step.
END
  }
  in_arg {
    name: "w"
    description: <<END
The weight matrix.
END
  }
  in_arg {
    name: "wci"
    description: <<END
The weight matrix for input gate peephole connection.
END
  }
  in_arg {
    name: "wcf"
    description: <<END
The weight matrix for forget gate peephole connection.
END
  }
  in_arg {
    name: "wco"
    description: <<END
The weight matrix for output gate peephole connection.
END
  }
  in_arg {
    name: "b"
    description: <<END
The bias vector.
END
  }
  out_arg {
    name: "i"
    description: <<END
The input gate.
END
  }
  out_arg {
    name: "cs"
    description: <<END
The cell state before the tanh.
END
  }
  out_arg {
    name: "f"
    description: <<END
The forget gate.
END
  }
  out_arg {
    name: "o"
    description: <<END
The output gate.
END
  }
  out_arg {
    name: "ci"
    description: <<END
The cell input.
END
  }
  out_arg {
    name: "co"
    description: <<END
The cell after the tanh.
END
  }
  out_arg {
    name: "h"
    description: <<END
The output h vector.
END
  }
  attr {
    name: "forget_bias"
    description: <<END
The forget gate bias.
END
  }
  attr {
    name: "cell_clip"
    description: <<END
Value to clip the 'cs' value to.
END
  }
  attr {
    name: "use_peephole"
    description: <<END
Whether to use peephole weights.
END
  }
  summary: "Computes the LSTM cell forward propagation for 1 time step."
  description: <<END
This implementation uses 1 weight matrix and 1 bias vector, and there's an
optional peephole connection.

This kernel op implements the following mathematical equations:

```python
xh = [x, h_prev]
[i, f, ci, o] = xh * w + b
f = f + forget_bias

if not use_peephole:
  wci = wcf = wco = 0

i = sigmoid(cs_prev * wci + i)
f = sigmoid(cs_prev * wcf + f)
ci = tanh(ci)

cs = ci .* i + cs_prev .* f
cs = clip(cs, cell_clip)

o = sigmoid(cs * wco + o)
co = tanh(cs)
h = co .* o
```
END
}
